<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加用户</title>
</head>
<body>
<form class="user" name="addSysUser" method="post" th:action="@{/sysUser/add}" th:object="${sysUser}">
    <input type="hidden" id="id" name="id" th:value="${sysUser?.id}">
    <div >
        <div >
            登录名：
            <input type="text"  th:field="*{loginName}" placeholder="登录名">
        </div>
        <div >
            密码：
            <input type="password" id="pwd1" th:field="*{password}" placeholder="密码">
        </div>
        <div >
            确认密码：
            <input type="password" id="pwd2" placeholder="确认密码">
        </div>
    </div>

    <div >
        <div >
            真实姓名：
            <input type="text"  th:field="*{realName}" placeholder="真实姓名">
        </div>
        <div >
            联系方式：
            <input type="text" th:field="*{mobile}" placeholder="联系方式">
        </div>
    </div>
    <input type="submit" value="添加/修改" class="btn btn-success" onclick="return check()" >
</form>
<script type="text/javascript" th:src="@{/js/jquery.js}"></script>

<script>
    function check() {
        if($("#pwd1").val() != $("#pwd2").val()){
            alert("密码不一致");
            return false;
        }
        return true;
    }
    </script>
</body>
</html>